<style>
    @font-face {
        font-family: brandon-grotesque;
        src: url("/assets/fonts/Brandon-Grotesque-Light.ttf")
    }

    div.myTips {
        font-family: brandon-grotesque;
        font-size: 14px;
        color: #686868;
        text-align: center;
        margin-top: 100px;
    }

    div.myTips h3 {
        font-size: 36px;
    }
</style>

<div class="wrapper-md">
    <div class="container myTips">
        <div class="row">

            <div class="col-md-12" style="padding-left:0px;margin-left: -10px;">
                <div>
                    <h3>
                        <span data-ng-if="code==0">
                            <i class="fa fa-check icon text-success" style="font-size: 80px;"></i>
                        </span>
                        <span data-ng-if="code!=0">
                            <i class="fa fa-times icon  text-danger" style="font-size: 80px;"></i>
                        </span>
                        {!message!}
                    </h3>
                    <div>
                        The Page Will Redirect After <b id="wait"> 3 </b> Seconds,
                        Click <a id="href" href='{!redirect!}'><b>Here</b></a> If Not.
                    </div>
                </div>
            </div>

        </div>
    </div>
</div>

<script type="text/javascript">
    'use strict';
    app.controller('MyFormCtrl', ['$scope', '$state', '$stateParams', function ($scope, $state, $stateParams) {
        $scope.code = $stateParams.code;
        $scope.message = $stateParams.message;
        $scope.redirect = $stateParams.redirect;

        (function(){
            var wait = document.getElementById('wait'),href = $scope.redirect;
            var interval = setInterval(function(){
                var time = --wait.innerHTML;
                if(time <= 0) {
                    location.href = href;
                    clearInterval(interval);
                };
            }, 1000);
        })();

    }]);
</script>